import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: "/home"
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login'),
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home/Home'),
    meta: {
      title:'你的野区我的【家】'
    },
    children: [
      {
        path: 'editShop',
        name:'EditShopInfo',
        component:()=>import('../views/adminController/EditShopInfo')
      },
      {
        path:'findShop',
        name:'FindShopInfo',
        component:()=>import('../views/adminController/FindShopInfo')
      },
      {
        path:'addShop',
        name:'AddShopInfo',
        component:()=>import('../views/adminController/AddShopInfo')
      }
    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

//路由跳转之前执行
//继续执行
//停止
router.beforeEach((to, from, next) => {
  next();
});

router.afterEach(() => {
})

export default router
